import myAxios from "@/request";
import type {
  EquipmentDataQueryRequest,
  EquipmentDataAddRequest,
  EquipmentDataUpdateRequest,
  PayRequest,
} from "@/models/equipmentData";

/**
 * 分页获取设备数据列表
 */
export function listEquipmentDataByPage(
  equipmentDataQueryRequest: EquipmentDataQueryRequest
) {
  return myAxios.request({
    url: "/api/equipmentData/list/page",
    method: "post",
    data: equipmentDataQueryRequest,
  });
}

/**
 * 添加设备数据
 */
export function addEquipmentData(
  equipmentDataAddRequest: EquipmentDataAddRequest
) {
  return myAxios.request({
    url: "/api/equipmentData/add",
    method: "post",
    data: equipmentDataAddRequest,
  });
}

/**
 * 更新设备数据
 */
export function updateEquipmentData(
  equipmentDataUpdateRequest: EquipmentDataUpdateRequest
) {
  return myAxios.request({
    url: "/api/equipmentData/update",
    method: "post",
    data: equipmentDataUpdateRequest,
  });
}

/**
 * 删除设备数据
 */
export function deleteEquipmentData(id: number) {
  return myAxios.request({
    url: "/api/equipmentData/delete",
    method: "post",
    data: { id },
  });
}

/**
 * 缴费
 */
export function payEquipmentData(payRequest: PayRequest) {
  return myAxios.request({
    url: "/api/equipmentData/pay",
    method: "post",
    params: payRequest,
  });
} 